package com.ccsoft.annoreflect.mapper;

import com.ccsoft.annoreflect.utils.MySqlProvider;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import java.util.List;
import java.util.Map;

/**
 * @author chanchaw
 * @create 2022-09-24 10:34
 */
public interface BaseMapper {

    @SelectProvider(type= MySqlProvider.class,method="getQueryListSQL")
    List<Map<String,Object>> queryList(@Param("requestData") Map<String,Object> params, @Param("modelClass") Class<?> modelClass);

    @UpdateProvider(type= MySqlProvider.class,method="getUpdateSQL")
    Integer update(@Param("requestData") Map<String,Object> params,@Param("modelClass") Class<?> modelClass);

    @DeleteProvider(type=MySqlProvider.class,method = "getDeleteSQL")
    Integer delete(@Param("requestData") Map<String,Object> params,@Param("modelClass") Class<?> modelClass);
}
